﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Sharp.Domain.Model;
using Sharp.Infrastructure;

namespace Sharp.Domain.CMSBoundedContext.AritcleModule.Aggregates
{
    /// <summary>
    /// 采集
    /// </summary>
    public partial class Gather : AggregateRoot
    {
        public Gather()
        {
            this.CheckInTime = DateTime.Now;
        }
         
        public string Name { get; set; }
        [IsMaxLength, NonUnicode]
        public string StartUrl { get; set; }
        [StringLength(2000)]
        public string CategoryArea { get; set; }
        [StringLength(2000)]
        public string ContentTitle { get; set; }
        [StringLength(2000)]
        public string UpdateTime { get; set; }
        [StringLength(2000)]
        public string ComeFrom { get; set; }
        [StringLength(2000)]
        public string Author { get; set; }
        [StringLength(2000)]
        public string Content { get; set; }
        [StringLength(2000)]
        public string ContentPageUrl { get; set; }
        [StringLength(2000)]
        public string FullArticleUrl { get; set; }
        [StringLength(2000)]
        public string CategoryPageNextUrl { get; set; }
        [StringLength(2000)]
        public string ContentPageNextUrl { get; set; }
        [StringLength(2000)]
        public string IgnoreUrl { get; set; }
        [StringLength(2000)]
        public string Filter { get; set; }
        [StringLength(2000)]
        public string Replace { get; set; }
        public bool CanDownImg { get; set; }
 
        public System.DateTime? LastWork { get; set; }
        public bool CanDrawWaterMark { get; set; }
        public bool IsExpert { get; set; }
        public Guid? ParentId { get; set; }
        public bool IsDisabled { get; set; }
        public System.DateTime CheckInTime { get; set; }
        public string Encoding { get; set; }
        /// <summary>
        /// 怎么采集
        /// </summary>
        /// <remarks>0、普通采集；1、蜘蛛、2、浏览器爬虫</remarks>
        public int IsSpider { get; set; }

        #region 蜘蛛爬虫专用
        /// <summary>
        /// 采集站内资源
        /// </summary>
        public bool Instation{ get; set; }
        /// <summary>
        /// 符合内容页url规律的正则表达式
        /// </summary>
        [StringLength(2000)]
        public string ContentPageRule { get; set; }
        /// <summary>
        /// 爬行哪几个域名下的url
        /// </summary>
        [StringLength(2000)]
        public string SpiderDomains{ get; set; }
        #endregion
        public Gather Parent { get; set; }
        public ICollection <Gather> Children { get; set; }
    }
}